//
//  ViewController.m
//  ControllerAndItsViewTest
//
//  Created by wangrui on 13-9-17.
//  Copyright (c) 2013年 PPS. All rights reserved.
//

#import "ViewController.h"
#import "AddedViewController.h"

@interface ViewController ()

@property (nonatomic,retain) NSMutableArray *testArr;
@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.testArr = [NSMutableArray array];
    
    AddedViewController *adc = [[AddedViewController alloc] init];
    [self.view addSubview:adc.view];
    adc.view.frame = CGRectMake(50, 50, 200, 300);
    
    //[self addChildViewController:adc];
    [self.testArr addObject:adc];
    [adc release];
}


- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)interval{
    NSLog(@"root rotate");
    [self.testArr makeObjectsPerformSelector:@selector(willRotateToInterfaceOrientation:duration:)];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
